import { post } from '@/utils/request'

/**
 * 题库详情
 * @param data
 */
export function nextQu(examId, quId) {
  return post('/exam/api/user/wrong-book/next', { examId: examId, quId: quId })
}

/**
 * 根据来源类型分页查询
 * @param data
 * @param sourceType
 * @returns {*}
 */
export function pagingBySource(data, sourceType) {
  return post('/exam/api/user/wrong-book/paging-by-source?sourceType=' + sourceType, data)
}

/**
 * 开始练习错题集
 * @param data
 * @returns {*}
 */
export function startPractice(data) {
  return post('/exam/api/user/wrong-book/start-practice', data)
}

/**
 * 获取下一个练习题目
 * @param data
 * @returns {*}
 */
export function getNextPracticeQu(data) {
  return post('/exam/api/user/wrong-book/next-practice', data)
}

/**
 * 提交练习答案
 * @param data
 * @returns {*}
 */
export function submitPracticeAnswer(data) {
  return post('/exam/api/user/wrong-book/submit-practice', data)
}

/**
 * 获取练习统计信息
 * @param data
 * @returns {*}
 */
export function getPracticeStats(data) {
  return post('/exam/api/user/wrong-book/practice-stats', data)
}

/**
 * 删除错题
 * @param ids
 * @returns {*}
 */
export function deleteWrongBook(ids) {
  return post('/exam/api/user/wrong-book/delete', { ids: ids })
}

